<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script>
        function check(){
            if(!document.getElementById("aaa").checked){
                alert("你必须同意协议");
                return false
            }else{
                alert("成功");
                return true
            }
        }
    </script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
    <div style="border:1px solid #ace;width:800px;height:400px;margin:5px auto;padding:5px">用户协议</div>
    <div style="width:800px;margin:5px auto;text-align:right">
        <p>
            <label>
                <input type="checkbox"  id="aaa" />
                我同意</label>
        </p>
        <p>
            <input type="submit" name="button" id="button" value="注册" onclick="return check()" />
        </p>
    </div>
</form>
</body>
</html>